define(["jquery", "easy-admin"], function ($, ea) {

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'dynamic/index',
        add_url: 'dynamic/add',
        edit_url: 'dynamic/edit',
        delete_url: 'dynamic/delete',
        export_url: 'dynamic/export',
        modify_url: 'dynamic/modify',
    };

    var Controller = {

        index: function () {
            ea.table.render({
                init: init,
                toolbar: ['refresh'],
                cols: [[
                    {field: 'id', title: 'id', search: false},
                    {field: 'service_technician_name', title: '达人名称'},
                    {field: 'type', title: '类型',selectList: {1: '视频',2:"图片"}},
                    {field: 'create_time', title: '发布时间', search: false},
                    {
                        width: 250,
                        title: '操作',
                        templet: ea.table.tool,
                        operat: [[
                            {
                                text: '查看详情',
                                url: init.edit_url,
                                method: 'open',
                                auth: 'edit',
                                class: 'layui-btn layui-btn-success layui-btn-xs',
                                extend: 'data-full="true"',
                            }
                        ],'delete']
                    }

                ]],
            });

            ea.listen();
        },
        add: function () {
            ea.listen();
        },
        edit: function () {
            ea.listen();
        },
    };
    return Controller;
});